import os


##

def getDirs(rootdir,filter_pre=None,filter_suf=None):
    dirs=[]
    for _, dirs, _ in os.walk(rootdir, topdown=True):
        dirs.sort()
        break
    if filter_pre:
        res=[]
        for d in dirs:
            for pre in filter_pre:
                if not d.startswith(pre):
                    res.append(d)
        dirs=res
    if filter_suf:
        res=[]
        for d in dirs:
            for suf in filter_suf:
                if not d.endswith(suf):
                    res.append(d)
        dirs=res
    return dirs


